// import api from "@/apis/index";
import { createStore } from 'vuex'

export default createStore({
  state: {
    userInfo: {},
    activeMenu: '',
    isMobile: false
  },
  mutations: {
    setUserInfo: (state, data) => {
      state.userInfo = data
    },
    setActiveMenu: (state, data) => {
      state.activeMenu = data
    },
    setMobile: (state, isMobile) => {
      state.isMobile = isMobile
    }
  },
  actions: {
    // asyncSetMainname: ({ commit }, data) => {
    // 	commit('setUserInfo', data)
    // },
    getUserData: async ({ commit }, data) => {
      // const res = await api.login.getUserInfoApi();
      // // todo
      // commit('setUserInfo', res.result)
    },
  },
  modules: {
  }
})
